/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/*
 * BeginScherm.java
 *
 * Created on 13-dec-2011, 10:32:04
 */
package view;
//test voor joris haah

import javax.swing.JOptionPane;
import components.Database;
/**
 *
 * @author tomkeim
 */
public class Hoofdscherm extends javax.swing.JFrame {

    /** Creates new form BeginScherm */
    public Hoofdscherm() {
        
        initComponents();
        
        
    
        if (!Database.openConnection("meru.hhs.nl", "db11031425", "usr11031425", "Dedaikahsh")) {
        
            JOptionPane.showMessageDialog(null, "De verbinding met de database is mislukt. Probeer het later opnieuw.");
            System.exit(0);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tabPaneel = new javax.swing.JTabbedPane();
        spelerTab = new javax.swing.JPanel();
        buttonSpelerToevoegen = new javax.swing.JButton();
        buttonOverzichtSpelers = new javax.swing.JButton();
        toernooiTab = new javax.swing.JPanel();
        buttonToernooiAanmaken = new javax.swing.JButton();
        buttonOverzichtToernooien = new javax.swing.JButton();
        toernooiinschrijving = new javax.swing.JButton();
        masterclassTab = new javax.swing.JPanel();
        buttonMasterclassAanmaken = new javax.swing.JButton();
        buttonOverzichtMasterclassess = new javax.swing.JButton();
        ingeschrevenSpelersButton = new javax.swing.JButton();
        rondeTab1 = new view.RondeTab();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Hoofdscherm");

        buttonSpelerToevoegen.setText("Speler toevoegen");
        buttonSpelerToevoegen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSpelerToevoegenActionPerformed(evt);
            }
        });

        buttonOverzichtSpelers.setText("Overzicht van spelers");
        buttonOverzichtSpelers.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonOverzichtSpelersActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout spelerTabLayout = new org.jdesktop.layout.GroupLayout(spelerTab);
        spelerTab.setLayout(spelerTabLayout);
        spelerTabLayout.setHorizontalGroup(
            spelerTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(spelerTabLayout.createSequentialGroup()
                .addContainerGap()
                .add(spelerTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(buttonSpelerToevoegen, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE)
                    .add(buttonOverzichtSpelers, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE))
                .addContainerGap())
        );
        spelerTabLayout.setVerticalGroup(
            spelerTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(spelerTabLayout.createSequentialGroup()
                .addContainerGap()
                .add(buttonSpelerToevoegen, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(buttonOverzichtSpelers, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(174, Short.MAX_VALUE))
        );

        tabPaneel.addTab("Speler", spelerTab);

        buttonToernooiAanmaken.setText("Toernooi aanmaken");
        buttonToernooiAanmaken.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonToernooiAanmakenActionPerformed(evt);
            }
        });

        buttonOverzichtToernooien.setText("Overzicht geplande toernooien");
        buttonOverzichtToernooien.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonOverzichtToernooienActionPerformed(evt);
            }
        });

        toernooiinschrijving.setText("Overzicht ingeschreven spelers");
        toernooiinschrijving.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                toernooiinschrijvingActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout toernooiTabLayout = new org.jdesktop.layout.GroupLayout(toernooiTab);
        toernooiTab.setLayout(toernooiTabLayout);
        toernooiTabLayout.setHorizontalGroup(
            toernooiTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(toernooiTabLayout.createSequentialGroup()
                .addContainerGap()
                .add(toernooiTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, toernooiinschrijving, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, buttonToernooiAanmaken, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, buttonOverzichtToernooien, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE))
                .addContainerGap())
        );
        toernooiTabLayout.setVerticalGroup(
            toernooiTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(toernooiTabLayout.createSequentialGroup()
                .addContainerGap()
                .add(buttonToernooiAanmaken, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(buttonOverzichtToernooien, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(toernooiinschrijving, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 51, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(107, Short.MAX_VALUE))
        );

        tabPaneel.addTab("Toernooi", toernooiTab);

        buttonMasterclassAanmaken.setText("Masterclass aanmaken");
        buttonMasterclassAanmaken.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonMasterclassAanmakenActionPerformed(evt);
            }
        });

        buttonOverzichtMasterclassess.setText("Overzicht masterclassess");
        buttonOverzichtMasterclassess.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonOverzichtMasterclassessActionPerformed(evt);
            }
        });

        ingeschrevenSpelersButton.setText("Ingeschreven spelers");
        ingeschrevenSpelersButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ingeschrevenSpelersButtonActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout masterclassTabLayout = new org.jdesktop.layout.GroupLayout(masterclassTab);
        masterclassTab.setLayout(masterclassTabLayout);
        masterclassTabLayout.setHorizontalGroup(
            masterclassTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(masterclassTabLayout.createSequentialGroup()
                .addContainerGap()
                .add(masterclassTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(buttonMasterclassAanmaken, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, buttonOverzichtMasterclassess, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, ingeschrevenSpelersButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE))
                .addContainerGap())
        );
        masterclassTabLayout.setVerticalGroup(
            masterclassTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(masterclassTabLayout.createSequentialGroup()
                .addContainerGap()
                .add(buttonMasterclassAanmaken, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(6, 6, 6)
                .add(buttonOverzichtMasterclassess, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(ingeschrevenSpelersButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 52, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(116, Short.MAX_VALUE))
        );

        tabPaneel.addTab("Masterclass", masterclassTab);
        tabPaneel.addTab("Ronde", rondeTab1);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(tabPaneel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 374, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(tabPaneel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 323, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void ingeschrevenSpelersButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ingeschrevenSpelersButtonActionPerformed
        new IngeschrevenSpelers().setVisible(true);
}//GEN-LAST:event_ingeschrevenSpelersButtonActionPerformed

private void buttonOverzichtMasterclassessActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonOverzichtMasterclassessActionPerformed
        // TODO add your handling code here:
        new MasterclassOverzicht().setVisible(true);
}//GEN-LAST:event_buttonOverzichtMasterclassessActionPerformed

private void buttonMasterclassAanmakenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMasterclassAanmakenActionPerformed
        new MasterclassAanmaken().setVisible(true);
}//GEN-LAST:event_buttonMasterclassAanmakenActionPerformed

private void toernooiinschrijvingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_toernooiinschrijvingActionPerformed
// TODO add your handling code here:
    new ToernooiInschrijvingen().setVisible(true);
}//GEN-LAST:event_toernooiinschrijvingActionPerformed

private void buttonOverzichtToernooienActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonOverzichtToernooienActionPerformed
        // TODO add your handling code here:
        new ToernooiOverzicht().setVisible(true);
}//GEN-LAST:event_buttonOverzichtToernooienActionPerformed

private void buttonToernooiAanmakenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonToernooiAanmakenActionPerformed
             // TODO add your handling code here:
        new ToernooiAanmaken().setVisible(true);
}//GEN-LAST:event_buttonToernooiAanmakenActionPerformed

private void buttonOverzichtSpelersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonOverzichtSpelersActionPerformed
        new SpelersOverzicht().setVisible(true);
}//GEN-LAST:event_buttonOverzichtSpelersActionPerformed

private void buttonSpelerToevoegenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSpelerToevoegenActionPerformed
        new SpelerToevoegen().setVisible(true);
}//GEN-LAST:event_buttonSpelerToevoegenActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        
                
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Hoofdscherm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Hoofdscherm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Hoofdscherm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Hoofdscherm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                Hoofdscherm hs = new Hoofdscherm();
               
                hs.setVisible(true);
                hs.setExtendedState(hs.getExtendedState() | hs.MAXIMIZED_BOTH);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton buttonMasterclassAanmaken;
    private javax.swing.JButton buttonOverzichtMasterclassess;
    private javax.swing.JButton buttonOverzichtSpelers;
    private javax.swing.JButton buttonOverzichtToernooien;
    private javax.swing.JButton buttonSpelerToevoegen;
    private javax.swing.JButton buttonToernooiAanmaken;
    private javax.swing.JButton ingeschrevenSpelersButton;
    private javax.swing.JPanel masterclassTab;
    private view.RondeTab rondeTab1;
    private javax.swing.JPanel spelerTab;
    private javax.swing.JTabbedPane tabPaneel;
    private javax.swing.JPanel toernooiTab;
    private javax.swing.JButton toernooiinschrijving;
    // End of variables declaration//GEN-END:variables
}
